package cn.yr.blog.controller.web;

import cn.yr.blog.service.TagService;
import cn.yr.common.core.domain.entity.YrTag;
import cn.yr.common.exception.ret.Ret;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (YrTag)表控制层
 *
 * @author lang
 * @since 2020-03-11 19:56:43
 */

@Api(tags = "web标签")
@RestController
@RequestMapping("/web/tag")
public class WebTagController {
    @Resource
    private TagService tagService;

    @RequestMapping("listTag")
    public Ret<List<YrTag>> listTag(){
        QueryWrapper<YrTag> tagWrapper = new QueryWrapper<>();
        tagWrapper.orderByAsc("create_time");
        List<YrTag> list = tagService.list(tagWrapper);
        return Ret.success(list);
    }

}